﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace ChinessChess
{
    class CImageChess : PictureBox
    {
        private ChessColor m_color;
        private ChessType m_type;
        private String m_name;
        private int index;
        private int m_dong;
        private int m_cot;
        private Boolean m_state;
        private int m_vt;

        public int Vt
        {
            get { return m_vt; }
            set { m_vt = value; }
        }
        public Boolean State
        {
            get { return m_state; }
            set { m_state = value; }
        }
        public int Dong
        {
            get { return m_dong; }
            set { m_dong = value; }
        }

        public int Cot
        {
            get { return m_cot; }
            set { m_cot = value; }
        }
        public String strName
        {
            get { return m_name; }
            set { m_name = value; }
        }
        public ChessType Type
        {
            get { return m_type; }
            set { m_type = value; }
        }

        public CImageChess() {
            m_vt = -1;
            m_state = true;
            this.Size = new Size(Program.size, Program.size);
            this.MouseEnter += new EventHandler(COCo_MouseEnter);
        }

        private void COCo_MouseEnter(object sender, EventArgs e)
        {
            Cursor = Cursors.Hand;
        }

        public ChessColor Color
        {
            get { return m_color; }
            set { m_color = value; }
        }

        public int Index
        {
            get { return index; }
            set { index = value; }
        }
        public void DrawChess(Image image, Form f, Region rg)
        {
            this.Image = image;
            this.Size = new Size(Program.size, Program.size);
            this.Location = new Point(Program.x + Program.kc * m_cot, Program.y + Program.kc * m_dong);
            this.Region = rg;
            f.Controls.Add(this);
        }
    }
}
